// 宽度改变
const screenChange = () => {
  const width = document.body.clientWidth;
  const app = document.querySelector("#app");
  let clazz = undefined;

  if (width >= 850) {
    clazz = "wid-850";
  } else if (width < 850 && width >= 350) {
    clazz = "wid-350";
  } else {
    clazz = "wid-300";
  }
  return (app.className = clazz);
  // app.classList.add(clazz);
};
// resieze
const resize = () => {
  window.addEventListener("resize", (e) => {
    screenChange();
  });
};

export default resize;
export { screenChange };
